#pragma once

#include <new>

{%- for cluster in clusters %}
{%-   if cluster | dynamicCluster(idl) %}
#include "bridge/{{cluster.name}}.h"
{%-   endif %}
{%- endfor %}

namespace clusters {

struct ClusterInfo
{
  chip::ClusterId id;
  const char *name;
  uint16_t size;
  GeneratedCluster* (*ctor)(void*);
} static const kKnownClusters[] = {
{% for cluster in clusters %}
{%-   if cluster | dynamicCluster(idl) %}
  {
    {{cluster.code}},
    "{{cluster.name}}",
    sizeof({{cluster.name}}Cluster),
    [](void *mem) -> GeneratedCluster* {
      return new(mem) {{cluster.name}}Cluster();
    },
  },
{%-   endif %}
{%- endfor %}
};

}
